const myBehavior = require("../../utils/my-behavior")

Component({
    // mix: [mixed],
    behaviors: [myBehavior],
    properties: {
        tit: {
            type: String,
            value: "Count"
        }
    },
    data: {
        count: 0
    },
    lifetimes: {
        attached() {
            console.log(this.data)
            console.log("counter attached")
        },
        detached() {
            console.log("counter detached")
        },
    },
    pageLifetimes: {
        show() {
            console.log("counter show")
        },
        hide() {
            console.log("counter hide")
        },
    },
    methods: {
        add() {
            this.setData({
                count:  this.data.count + 1
            })
            // console.log(this.data.count)
        },
        jian() {
            this.setData({
                count:  this.data.count - 1
            })
            // console.log(this.data.count)
        }
    }
});
